//	--------------------------------------------------------------------
//	Copyright(C) 2006,2007 Zhao Yukun. All rights reserved.
//	This file is a part of the Xeres system.
//	Xeres 2007
//	Contact : xeres.engine@gmail.com
//	$(reservedInfo)
//	$(reservedDeclaration)
//	--------------------------------------------------------------------
///	@file	<CCameraBase.h>
///	@path	~/src/scene/camera/
///	@date	2008/04/24
///	@desc	.

#pragma once

#include "xeres.h"

#include "scene/ICamera.h"
#include "scene/IScene.h"

namespace xeres {

	// forward declaration
	class CPerspectiveView;

	/*! 
		\class	CCameraBase
		\brief	Base camera implementation.
	*/
	class CCameraBase : public ICamera
	{
	public:

		/// \ctor
		CCameraBase( void );

		/// \dtor
		virtual ~CCameraBase( void );

		DECL_IOBJECT_CLASS( CCameraBase , ICamera );

	public:

		/// \name ILive Interface
		//@{

		/*! 
			\brief		Construct live object.
		*/
		virtual void Construct( ResourceLoader * loader , RefWeak<IData> res );

		/*! 
			\brief		AttachModel
		*/
		virtual void AttachModel( RefWeak<IModel> model );

		/*!
			\brief		Called when entity is placed into a scene.
		*/
		virtual void EnterScene( RefWeak<IScene> scene );

		/*!
			\brief		Called when entity is going to leave the scene.
		*/
		virtual void LeaveScene( RefWeak<IScene> scene );

		/*!
			\brief		Tick update entity.
		*/
		virtual void Tick( const Frame & frame );

		/*!
			\brief		Make presentation of live. (presentation will be rendered)
		*/
		virtual void Present( ScenePresentation& sp );

		//@}

		/// \name ICamera Interface
		//@{

		/// \brief	Get view.
		virtual RefWeak<IView> GetCameraView( void );

		//@}

	private:

		//@ data
		Ref<IView>		m_view;
	};

} // namespace xeres
